@extends('base')

@section('content')
    <div class="layui-card">
        <div class="layui-card-body">
            <form action="{{route('caiwu.finance.store')}}" method="post" class="layui-form">
                {{csrf_field()}}
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">选择订单</label>
                    <div class="layui-input-inline" style="width: 90px">
                        <button type="button" id="chose_order" class="layui-btn layui-btn-sm">点击选择</button>
                    </div>
                    <input type="hidden" name="order_id" value="0" id="order_id">
                    <div class="layui-word-aux layui-form-mid" id="order_tips"></div>
                </div>

                <div class="layui-form-item">
                    <label for="" class="layui-form-label">收支方式</label>
                    <div class="layui-input-block">
                        <select name="pay_type" lay-verify="required">
                            @foreach(config('freeswitch.pay_type') as $k => $v)
                                <option value="{{$k}}">{{$v}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">收支金额</label>
                    <div class="layui-input-block">
                        <input class="layui-input" type="number" name="money" value="0" lay-verify="required" placeholder="收支金额">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea name="remark" class="layui-textarea" lay-verify="required" ></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="" class="layui-form-label">付款凭证</label>
                    <div class="layui-input-block">
                        @include('common.multiple_file')
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn layui-btn-sm" lay-submit lay-filter="go-close-refresh" >确认</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection

@section('script')
    <script>
        layui.use(['element', 'form', 'layer', 'table', 'upload', 'laydate', 'jquery'], function () {
            var $ = layui.jquery;
            var form = layui.form;
            var table = layui.table;
            var layer = layui.layer;
            var laydate = layui.laydate;

            $("#chose_order").click(function () {
                layer.open({
                    type: 2,
                    title: false,
                    shadeClose: true,
                    area: ["80%","80%"],
                    content: "{{route('api.choseOrder')}}",
                })
            })

        });
    </script>
@endsection
